import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a1227
 * Date: 2022-09-07
 * Time: 11:18
 */
public class Test {
    /**
     * 井字棋
     * @param args
     */
    /*
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        char [][]board = new char[3][3];
        for(int i = 0; i < board.length; i++){
            for(int j = 0; j < board[i].length; j++){
                board[i][j] = scan.next().charAt(0);
            }
        }
        //判断行
        for(int i = 0; i < board.length; i++){
            if(board[i][0] == board[i][1] && board[i][1] == board[i][2]){
                if(board[i][0] == 'K'){
                    System.out.println("KiKi wins!");
                    return ;
                }else if(board[i][0] == 'B'){
                    System.out.println("BoBo wins!");
                    return ;
                }else{
                    System.out.println("No winner!");
                    return ;
                }
            }
        }
        //判断列
        for(int i = 0; i < board.length; i++){
            if(board[0][i] == board[1][i] && board[1][i] == board[2][i]){
                if(board[0][i] == 'K'){
                    System.out.println("KiKi wins!");
                    return ;
                }else if(board[0][i] == 'B'){
                    System.out.println("BoBo wins!");
                    return ;
                }else{
                    System.out.println("No winner!");
                    return ;
                }
            }
        }
        //判断对角
        if(board[0][0] == board[1][1] && board[1][1] == board[2][2]){
            if(board[0][0] == 'K'){
                System.out.println("KiKi wins!");
                return ;
            }else if(board[0][0] == 'B'){
                System.out.println("BoBo wins!");
                return ;
            }else{
                System.out.println("No winner!");
                return ;
            }
        }
        if(board[0][2] == board[1][1] && board[1][1] == board[2][0]){
            if(board[0][2] == 'K'){
                System.out.println("KiKi wins!");
                return ;
            }else if(board[0][2] == 'B'){
                System.out.println("BoBo wins!");
                return ;
            }else{
                System.out.println("No winner!");
                return ;
            }
        }
    }
    */

    /**
     * 杨辉三角
     * @param args
     */
    /*
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int [][]ary = new int[n][n];
        for(int i = 0; i < n; i++){
            for(int j = 0; j <= i; j++){
                if(j == 0 || j == i){
                    ary[i][j] = 1;
                }else{
                    ary[i][j] = ary[i - 1][j - 1] + ary[i - 1][j];
                }
            }
        }
        for(int i = 0; i < ary.length; i++){
            for(int j = 0; j <= i; j++){
                System.out.printf("%5d",ary[i][j]);
            }
            System.out.println();
        }
    }
    */

    /**
     * KiKi判断上三角矩阵
     * @param args
     */
    /*
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[][] ary = new int[n][n];
        for(int i = 0; i < ary.length; i++){
            for(int j = 0; j < ary[i].length; j++){
                ary[i][j] = scan.nextInt();
                if(j < i){
                    if(ary[i][j] != 0){
                        System.out.println("NO");
                        return ;
                    }
                }
            }
        }
        System.out.println("YES");
    }
    */
}
